package dfbz.demo02;

import java.util.Random;
import java.util.Scanner;

public class Test01 {
    public static void main(String[] args) {
         Random rd=new Random();
         int v1=rd.nextInt(100);
        int i=1;
        while (i<6){
            System.out.println("第"+i+"次机会");
            System.out.println("请输入一个数字猜游戏");
            Scanner in=new Scanner(System.in);
            int inputNum=in.nextInt();
            Game g=new Game(inputNum,v1);
            g.guess();
            i++;
            if(i==5){
                System.out.println("你没有机会了");
                System.out.println("正确答案为:"+v1);
                break;
            }
        }
    }
}
